package com.doone.telmarket.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.doone.telmarket.domain.ibator.ServiceType;
import com.doone.telmarket.domain.ibator.ServiceTypeExample;
import com.doone.telmarket.service.ServiceTypeOperation;
import com.doone.telmarket.infrastructure.dao.ServiceTypeDAO;

@Service("serviceTypeOperation")
public class ServiceTypeOperationImpl implements ServiceTypeOperation {

	@Autowired
	private ServiceTypeDAO serviceTypeDAO; 

	/**
	 * @description 删除增值业务服务类别
	 * @author 甘雨波
	 * @date 2009-9-15 10:25
	 * @return
	 */
	public int deleteIsmpServiceType(int id) {
		return serviceTypeDAO.deleteByPrimaryKey(id);
	}

	/**
	 * @description 保存增值业务服务类别
	 * @author 甘雨波
	 * @date 2009-9-14 10:41
	 * @return
	 */
	public int saveIsmpServiceType(ServiceType type) {
		return serviceTypeDAO.insert(type);
	}

	/**
	 * @description 编辑增值业务服务类别
	 * @author 甘雨波
	 * @date 2009-9-14 10:55
	 * @return
	 */
	public int updateIsmpServiceType(ServiceType type) {
		return serviceTypeDAO.updateByPrimaryKey(type);
	}

	/**
	 * @description 获取所有增值业务服务类别列表
	 * @author 甘雨波
	 * @date 2009-9-15 10:13
	 * @return
	 */
	public List<ServiceType> selectAllServiceType() {
		return serviceTypeDAO.selectByExample(new ServiceTypeExample());
	}

	public ServiceType selectByPrimarykey(int id) {
		// TODO Auto-generated method stub
		return serviceTypeDAO.selectByPrimaryKey(id);
	}

}
